<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--conf
<sample>
	<product version="1.0" edition="std"/>
	<modifications>
		<modified date="080205"/>
	</modifications>
<sampledescription><![CDATA[ ]]></sampledescription></sample>
 --> 

<html>
<head>
	<title>Drag data from DataView to HTML container</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
  
	<style type="text/css">
		body{
			-webkit-user-select:none;
			-moz-user-select:none;
			user-select:none;
		}
	</style>
<body>
	<h1>Drag data from DataView to HTML container</h1>
	<div id="data_container1" style="border:1px solid #A4BED4; background-color:white;width:400px;height:396px; float:left;"></div>				
	<div style="width:50px; float:left">&nbsp;</div>
	<div id="data_container2" style="background-color:white;width:400px;height:396px;border:1px solid red;overflow:auto; float:left;">
		Drop some item here
	</div>				
	<div style="clear:both"></div>	
	
	<script>
		data = new dhtmlXDataView({
			container:"data_container1",
			type:{
				template:"#Package# : #Version#<br/>#Maintainer#",
				padding:5,
				height:40
			},
			drag:true
		});
		data.load("../common/data.xml");
		
		dhtmlx.DragControl.addDrop("data_container2",{
			onDrop:function(source, target, d, e){
				var context = dhtmlx.DragControl.getContext();
				var item = context.from.get(context.source[0]);
				
				var d = document.createElement("DIV");
				d.innerHTML = item.Package+" - "+item.Version;
				target.appendChild(d);
			}
		});
	</script>
	
</body>
</html>

